package org.example.dialogue.controller;

import io.swagger.v3.oas.annotations.Operation;
import lombok.extern.slf4j.Slf4j;
import org.example.ai.result.Result;
import org.example.dialogue.pojo.Conversations;
import org.example.dialogue.service.ServiceConversations;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author zqtao
 */

@Slf4j
@RestController
@RequestMapping("/conversations")
public class ConversationsController {

    @Autowired
    private ServiceConversations serviceConversations;

    @Operation(summary = "获取对话记录")
    @GetMapping("/getHistoryMessage/{userId}")
    public Result<List<Conversations>> getHistoryMessage(@PathVariable Long userId){
        return Result.ok(serviceConversations.getHistoryMessage(userId));
    }




}
